import type { AddressItem } from '@/types/address'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useAddressStore = defineStore('xiao-tu-xian-address', () => {
  // 选中地址
  const selectedAddress = ref<AddressItem>()

  // 设置选中地址
  const setSelectedAddress = (address: AddressItem) => {
    selectedAddress.value = address
  }

  return {
    selectedAddress,
    setSelectedAddress
  }
})
